package com.jdz.gxq.info.admin.registration.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.jdz.gxq.info.admin.registration.bo.Registration;
import com.jdz.gxq.info.admin.registration.form.EditRegistrationForm;
import com.jdz.gxq.info.admin.registration.service.RegistrationService;
import com.jdz.gxq.info.common.action.CommonAction;

public class EditRegistrationAction extends CommonAction {

	private RegistrationService registrationService = null;
	 
	public ActionForward doExecute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws java.lang.Exception {
		
		EditRegistrationForm editRegistrationForm = (EditRegistrationForm) form;
	
		Registration registration = registrationService.getRegistrationById(editRegistrationForm.getId());
		
		editRegistrationForm.setRegistration(registration);

		return mapping.findForward("success");
	}

	public void setRegistrationService(RegistrationService registrationService) {
		this.registrationService = registrationService;
	}
}

